Skip to content

Commit

Permalink
Template arguments to templates in std must have complete types.
Browse files Browse the repository at this point in the history
Removing several forward declarations to ensure complete
types when instantiating a template in std.
clang++ on mac complains about this issue if building with libc++.

BUG=267500
R=thakis@chromium.org

Review URL: https://chromiumcodereview.appspot.com/22633003

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@220094 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
zeno.albisser@digia.com committed Aug 28, 2013
1 parent 0fa0008 commit bdd8ea3
Show file tree
Hide file tree
Showing 10 changed files with 93 additions and 100 deletions.
1 change: 1 addition & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,7 @@ Yoshinori Sano <yoshinori.sano@gmail.com>
YoungKi Hong <simon.hong81@gmail.com>
Yumikiyo Osanai <yumios.art@gmail.com>
Yuri Gorobets <yuri.gorobets@gmail.com>
Zeno Albisser <zeno.albisser@digia.com>
Zheng Chuang <zhengchuangscu@gmail.com>
方觉 (Fang Jue) <fangjue23303@gmail.com>

Expand Down
3 changes: 1 addition & 2 deletions content/browser/dom_storage/dom_storage_namespace.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@
#include "base/files/file_path.h"
#include "base/memory/ref_counted.h"
#include "content/common/content_export.h"

class GURL;
#include "url/gurl.h"

namespace content {

Expand Down
2 changes: 1 addition & 1 deletion content/browser/indexed_db/indexed_db_dispatcher_host.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
#include "base/id_map.h"
#include "base/memory/ref_counted.h"
#include "content/public/browser/browser_message_filter.h"
#include "url/gurl.h"

class GURL;
struct IndexedDBDatabaseMetadata;
struct IndexedDBHostMsg_DatabaseCount_Params;
struct IndexedDBHostMsg_DatabaseCreateIndex_Params;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,14 @@
#include "content/browser/renderer_host/pepper/content_browser_pepper_host_factory.h"
#include "content/browser/renderer_host/pepper/ssl_context_helper.h"
#include "content/common/content_export.h"
#include "content/common/pepper_renderer_instance_data.h"
#include "content/public/browser/browser_ppapi_host.h"
#include "content/public/common/process_type.h"
#include "ipc/ipc_channel_proxy.h"
#include "ppapi/host/ppapi_host.h"

namespace content {

struct PepperRendererInstanceData;

class CONTENT_EXPORT BrowserPpapiHostImpl : public BrowserPpapiHost {
public:
// The creator is responsible for calling set_plugin_process_handle as soon
Expand Down
3 changes: 1 addition & 2 deletions content/public/test/test_file_error_injector.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@
#include "base/memory/scoped_ptr.h"
#include "base/memory/ref_counted.h"
#include "content/public/browser/download_interrupt_reasons.h"

class GURL;
#include "url/gurl.h"

namespace content {

Expand Down
1 change: 1 addition & 0 deletions content/renderer/media/media_stream_center.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#include "third_party/WebKit/public/platform/WebMediaStream.h"
#include "third_party/WebKit/public/platform/WebMediaStreamCenter.h"
#include "third_party/WebKit/public/platform/WebMediaStreamTrack.h"
#include "third_party/WebKit/public/platform/WebMediaStreamTrackSourcesRequest.h"

namespace WebKit {
class WebMediaStreamCenterClient;
Expand Down
144 changes: 71 additions & 73 deletions net/http/http_auth_cache.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,77 @@ namespace net {
// Entries can be looked up by either (origin, realm, scheme) or (origin, path).
class NET_EXPORT_PRIVATE HttpAuthCache {
public:
class Entry;
class NET_EXPORT_PRIVATE Entry {
public:
~Entry();

const GURL& origin() const {
return origin_;
}

// The case-sensitive realm string of the challenge.
const std::string realm() const {
return realm_;
}

// The authentication scheme of the challenge.
HttpAuth::Scheme scheme() const {
return scheme_;
}

// The authentication challenge.
const std::string auth_challenge() const {
return auth_challenge_;
}

// The login credentials.
const AuthCredentials& credentials() const {
return credentials_;
}

int IncrementNonceCount() {
return ++nonce_count_;
}

void UpdateStaleChallenge(const std::string& auth_challenge);

private:
friend class HttpAuthCache;
FRIEND_TEST_ALL_PREFIXES(HttpAuthCacheTest, AddPath);
FRIEND_TEST_ALL_PREFIXES(HttpAuthCacheTest, AddToExistingEntry);

typedef std::list<std::string> PathList;

Entry();

// Adds a path defining the realm's protection space. If the path is
// already contained in the protection space, is a no-op.
void AddPath(const std::string& path);

// Returns true if |dir| is contained within the realm's protection
// space. |*path_len| is set to the length of the enclosing path if
// such a path exists and |path_len| is non-NULL. If no enclosing
// path is found, |*path_len| is left unmodified.
//
// Note that proxy auth cache entries are associated with empty
// paths. Therefore it is possible for HasEnclosingPath() to return
// true and set |*path_len| to 0.
bool HasEnclosingPath(const std::string& dir, size_t* path_len);

// |origin_| contains the {protocol, host, port} of the server.
GURL origin_;
std::string realm_;
HttpAuth::Scheme scheme_;

// Identity.
std::string auth_challenge_;
AuthCredentials credentials_;

int nonce_count_;

// List of paths that define the realm's protection space.
PathList paths_;
};

// Prevent unbounded memory growth. These are safeguards for abuse; it is
// not expected that the limits will be reached in ordinary usage.
Expand Down Expand Up @@ -106,78 +176,6 @@ class NET_EXPORT_PRIVATE HttpAuthCache {
};

// An authentication realm entry.
class NET_EXPORT_PRIVATE HttpAuthCache::Entry {
public:
~Entry();

const GURL& origin() const {
return origin_;
}

// The case-sensitive realm string of the challenge.
const std::string realm() const {
return realm_;
}

// The authentication scheme of the challenge.
HttpAuth::Scheme scheme() const {
return scheme_;
}

// The authentication challenge.
const std::string auth_challenge() const {
return auth_challenge_;
}

// The login credentials.
const AuthCredentials& credentials() const {
return credentials_;
}

int IncrementNonceCount() {
return ++nonce_count_;
}

void UpdateStaleChallenge(const std::string& auth_challenge);

private:
friend class HttpAuthCache;
FRIEND_TEST_ALL_PREFIXES(HttpAuthCacheTest, AddPath);
FRIEND_TEST_ALL_PREFIXES(HttpAuthCacheTest, AddToExistingEntry);

typedef std::list<std::string> PathList;

Entry();

// Adds a path defining the realm's protection space. If the path is
// already contained in the protection space, is a no-op.
void AddPath(const std::string& path);

// Returns true if |dir| is contained within the realm's protection
// space. |*path_len| is set to the length of the enclosing path if
// such a path exists and |path_len| is non-NULL. If no enclosing
// path is found, |*path_len| is left unmodified.
//
// Note that proxy auth cache entries are associated with empty
// paths. Therefore it is possible for HasEnclosingPath() to return
// true and set |*path_len| to 0.
bool HasEnclosingPath(const std::string& dir, size_t* path_len);

// |origin_| contains the {protocol, host, port} of the server.
GURL origin_;
std::string realm_;
HttpAuth::Scheme scheme_;

// Identity.
std::string auth_challenge_;
AuthCredentials credentials_;

int nonce_count_;

// List of paths that define the realm's protection space.
PathList paths_;
};

} // namespace net

#endif // NET_HTTP_HTTP_AUTH_CACHE_H_
23 changes: 10 additions & 13 deletions ui/gfx/image/image_family.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,16 @@ class Size;
// include high-DPI representations).
class UI_EXPORT ImageFamily {
private:
// Forward declaration.
struct MapKey;
// An <aspect ratio, DIP width> pair.
// A 0x0 image has aspect ratio 1.0. 0xN and Nx0 images are treated as 0x0.
struct MapKey : std::pair<float, int> {
MapKey(float aspect, int width)
: std::pair<float, int>(aspect, width) {}

float aspect() const { return first; }

int width() const { return second; }
};

public:
// Type for iterating over all images in the family, in order.
Expand Down Expand Up @@ -127,17 +135,6 @@ class UI_EXPORT ImageFamily {
const gfx::Image* GetBest(const gfx::Size& size) const;

private:
// An <aspect ratio, DIP width> pair.
// A 0x0 image has aspect ratio 1.0. 0xN and Nx0 images are treated as 0x0.
struct MapKey : std::pair<float, int> {
MapKey(float aspect, int width)
: std::pair<float, int>(aspect, width) {}

float aspect() const { return first; }

int width() const { return second; }
};

// Find the closest aspect ratio in the map to |desired_aspect|.
// Ties are broken by the thinner aspect.
// |map_| must not be empty. |desired_aspect| must be > 0.0.
Expand Down
5 changes: 0 additions & 5 deletions webkit/support/weburl_loader_mock_factory.cc
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,6 @@ using WebKit::WebURLLoader;
using WebKit::WebURLRequest;
using WebKit::WebURLResponse;

struct WebURLLoaderMockFactory::ResponseInfo {
WebKit::WebURLResponse response;
base::FilePath file_path;
};

WebURLLoaderMockFactory::WebURLLoaderMockFactory() {}

WebURLLoaderMockFactory::~WebURLLoaderMockFactory() {}
Expand Down
8 changes: 6 additions & 2 deletions webkit/support/weburl_loader_mock_factory.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@

#include "base/files/file_path.h"
#include "third_party/WebKit/public/platform/WebURL.h"
#include "third_party/WebKit/public/platform/WebURLError.h"
#include "third_party/WebKit/public/platform/WebURLRequest.h"
#include "third_party/WebKit/public/platform/WebURLResponse.h"

namespace WebKit {
class WebData;
struct WebURLError;
class WebURLLoader;
}

Expand Down Expand Up @@ -75,7 +75,11 @@ class WebURLLoaderMockFactory {
void CancelLoad(WebURLLoaderMock* loader);

private:
struct ResponseInfo;
struct ResponseInfo {
WebKit::WebURLResponse response;
base::FilePath file_path;
};


// Loads the specified request and populates the response, error and data
// accordingly.
Expand Down

0 comments on commit bdd8ea3

Please sign in to comment.