Fix API changes

This commit is contained in:
Cheng Zhao 2015-04-21 18:54:57 +08:00
parent 80dd72b93c
commit 90b255f2cd
6 changed files with 40 additions and 31 deletions

View file

@ -50,17 +50,24 @@ const char kTargetTypeOther[] = "other";
class TCPServerSocketFactory
: public content::DevToolsHttpHandler::ServerSocketFactory {
public:
TCPServerSocketFactory(const std::string& address, int port, int backlog)
: content::DevToolsHttpHandler::ServerSocketFactory(
address, port, backlog) {}
TCPServerSocketFactory(const std::string& address, int port)
: address_(address), port_(port) {
}
private:
// content::DevToolsHttpHandler::ServerSocketFactory.
scoped_ptr<net::ServerSocket> Create() const override {
return scoped_ptr<net::ServerSocket>(
new net::TCPServerSocket(NULL, net::NetLog::Source()));
scoped_ptr<net::ServerSocket> CreateForHttpServer() override {
scoped_ptr<net::ServerSocket> socket(
new net::TCPServerSocket(nullptr, net::NetLog::Source()));
if (socket->ListenWithAddressAndPort(address_, port_, 10) != net::OK)
return scoped_ptr<net::ServerSocket>();
return socket;
}
std::string address_;
uint16 port_;
DISALLOW_COPY_AND_ASSIGN(TCPServerSocketFactory);
};
@ -82,7 +89,7 @@ CreateSocketFactory() {
}
}
return scoped_ptr<content::DevToolsHttpHandler::ServerSocketFactory>(
new TCPServerSocketFactory("127.0.0.1", port, 1));
new TCPServerSocketFactory("127.0.0.1", port));
}
class Target : public content::DevToolsTarget {
@ -152,8 +159,6 @@ class DevToolsDelegate : public content::DevToolsHttpHandlerDelegate {
std::string GetDiscoveryPageHTML() override;
bool BundlesFrontendResources() override;
base::FilePath GetDebugFrontendDir() override;
scoped_ptr<net::ServerSocket> CreateSocketForTethering(
std::string* name) override;
private:
DISALLOW_COPY_AND_ASSIGN(DevToolsDelegate);
@ -178,11 +183,6 @@ base::FilePath DevToolsDelegate::GetDebugFrontendDir() {
return base::FilePath();
}
scoped_ptr<net::ServerSocket> DevToolsDelegate::CreateSocketForTethering(
std::string* name) {
return scoped_ptr<net::ServerSocket>();
}
} // namespace
// DevToolsManagerDelegate ---------------------------------------------------

View file

@ -324,6 +324,7 @@ void InspectableWebContentsImpl::AgentHostClosed(
}
void InspectableWebContentsImpl::AboutToNavigateRenderFrame(
content::RenderFrameHost* old_host,
content::RenderFrameHost* new_host) {
if (new_host->GetParent())
return;

View file

@ -104,7 +104,8 @@ class InspectableWebContentsImpl :
bool replaced) override;
// content::WebContentsObserver:
void AboutToNavigateRenderFrame(content::RenderFrameHost* new_host) override;
void AboutToNavigateRenderFrame(content::RenderFrameHost* old_host,
content::RenderFrameHost* new_host) override;
void DidFinishLoad(content::RenderFrameHost* render_frame_host,
const GURL& validated_url) override;
void WebContentsDestroyed() override;

View file

@ -27,7 +27,14 @@ NotificationPresenter* PlatformNotificationServiceImpl::notification_presenter()
return notification_presenter_.get();
}
blink::WebNotificationPermission PlatformNotificationServiceImpl::CheckPermission(
blink::WebNotificationPermission PlatformNotificationServiceImpl::CheckPermissionOnUIThread(
content::BrowserContext* browser_context,
const GURL& origin,
int render_process_id) {
return blink::WebNotificationPermissionAllowed;
}
blink::WebNotificationPermission PlatformNotificationServiceImpl::CheckPermissionOnIOThread(
content::ResourceContext* resource_context,
const GURL& origin,
int render_process_id) {
@ -40,7 +47,6 @@ void PlatformNotificationServiceImpl::DisplayNotification(
const SkBitmap& icon,
const content::PlatformNotificationData& notification_data,
scoped_ptr<content::DesktopNotificationDelegate> delegate,
int render_process_id,
base::Closure* cancel_callback) {
auto presenter = notification_presenter();
if (presenter)
@ -49,11 +55,10 @@ void PlatformNotificationServiceImpl::DisplayNotification(
void PlatformNotificationServiceImpl::DisplayPersistentNotification(
content::BrowserContext* browser_context,
int64 service_worker_registration_id,
int64_t service_worker_registration_id,
const GURL& origin,
const SkBitmap& icon,
const content::PlatformNotificationData& notification_data,
int render_process_id) {
const content::PlatformNotificationData& notification_data) {
}
void PlatformNotificationServiceImpl::ClosePersistentNotification(

View file

@ -28,26 +28,28 @@ class PlatformNotificationServiceImpl
~PlatformNotificationServiceImpl() override;
// content::PlatformNotificationService:
virtual blink::WebNotificationPermission CheckPermission(
blink::WebNotificationPermission CheckPermissionOnUIThread(
content::BrowserContext* browser_context,
const GURL& origin,
int render_process_id) override;
blink::WebNotificationPermission CheckPermissionOnIOThread(
content::ResourceContext* resource_context,
const GURL& origin,
int render_process_id) override;
virtual void DisplayNotification(
void DisplayNotification(
content::BrowserContext* browser_context,
const GURL& origin,
const SkBitmap& icon,
const content::PlatformNotificationData& notification_data,
scoped_ptr<content::DesktopNotificationDelegate> delegate,
int render_process_id,
base::Closure* cancel_callback) override;
virtual void DisplayPersistentNotification(
void DisplayPersistentNotification(
content::BrowserContext* browser_context,
int64 service_worker_registration_id,
int64_t service_worker_registration_id,
const GURL& origin,
const SkBitmap& icon,
const content::PlatformNotificationData& notification_data,
int render_process_id) override;
virtual void ClosePersistentNotification(
const content::PlatformNotificationData& notification_data) override;
void ClosePersistentNotification(
content::BrowserContext* browser_context,
const std::string& persistent_notification_id) override;

View file

@ -154,9 +154,9 @@ net::URLRequestContext* URLRequestContextGetter::GetURLRequestContext() {
content::CookieStoreConfig::EPHEMERAL_SESSION_COOKIES,
NULL, NULL);
storage_->set_cookie_store(content::CreateCookieStore(cookie_config));
storage_->set_channel_id_service(new net::ChannelIDService(
new net::DefaultChannelIDStore(NULL),
base::WorkerPool::GetTaskRunner(true)));
storage_->set_channel_id_service(make_scoped_ptr(
new net::ChannelIDService(new net::DefaultChannelIDStore(NULL),
base::WorkerPool::GetTaskRunner(true))));
storage_->set_http_user_agent_settings(new net::StaticHttpUserAgentSettings(
"en-us,en", base::EmptyString()));