Update to Chromium revision 228917.

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1467 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
Marshall Greenblatt
2013-10-16 23:09:07 +00:00
parent b00630d039
commit d816fde859
13 changed files with 200 additions and 156 deletions

View File

@@ -17,5 +17,5 @@
{ {
'chromium_url': 'http://src.chromium.org/svn/trunk/src', 'chromium_url': 'http://src.chromium.org/svn/trunk/src',
'chromium_revision': '224845', 'chromium_revision': '228917',
} }

View File

@@ -800,9 +800,9 @@
'<(DEPTH)/ui/gl/gl.gyp:gl', '<(DEPTH)/ui/gl/gl.gyp:gl',
'<(DEPTH)/ui/ui.gyp:ui', '<(DEPTH)/ui/ui.gyp:ui',
'<(DEPTH)/v8/tools/gyp/v8.gyp:v8', '<(DEPTH)/v8/tools/gyp/v8.gyp:v8',
'<(DEPTH)/webkit/glue/webkit_glue.gyp:glue',
'<(DEPTH)/webkit/storage_browser.gyp:webkit_storage_browser', '<(DEPTH)/webkit/storage_browser.gyp:webkit_storage_browser',
'<(DEPTH)/webkit/storage_common.gyp:webkit_storage_common', '<(DEPTH)/webkit/storage_common.gyp:webkit_storage_common',
'<(DEPTH)/webkit/support/webkit_support.gyp:glue',
# Necessary to generate the grit include files. # Necessary to generate the grit include files.
'cef_pak', 'cef_pak',
], ],

View File

@@ -14,105 +14,96 @@
#include "base/rand_util.h" #include "base/rand_util.h"
#include "base/strings/stringprintf.h" #include "base/strings/stringprintf.h"
#include "base/strings/string_number_conversions.h" #include "base/strings/string_number_conversions.h"
#include "base/strings/utf_string_conversions.h"
#include "content/public/browser/devtools_agent_host.h"
#include "base/time/time.h" #include "base/time/time.h"
#include "content/public/browser/devtools_http_handler.h" #include "content/public/browser/devtools_http_handler.h"
#include "content/public/browser/render_process_host.h" #include "content/public/browser/devtools_target.h"
#include "content/public/browser/favicon_status.h"
#include "content/public/browser/navigation_entry.h"
#include "content/public/browser/render_view_host.h" #include "content/public/browser/render_view_host.h"
#include "content/public/browser/render_widget_host_iterator.h" #include "content/public/browser/render_widget_host_iterator.h"
#include "content/public/browser/web_contents.h"
#include "content/public/browser/web_contents_delegate.h"
#include "content/public/common/content_switches.h" #include "content/public/common/content_switches.h"
#include "content/public/common/url_constants.h" #include "content/public/common/url_constants.h"
#include "grit/cef_resources.h" #include "grit/cef_resources.h"
#include "net/base/escape.h"
#include "net/socket/tcp_listen_socket.h" #include "net/socket/tcp_listen_socket.h"
#include "ui/base/layout.h" #include "ui/base/layout.h"
#include "ui/base/resource/resource_bundle.h" #include "ui/base/resource/resource_bundle.h"
// CefDevToolsBindingHandler namespace {
CefDevToolsBindingHandler::CefDevToolsBindingHandler() { const char kTargetTypePage[] = "page";
class Target : public content::DevToolsTarget {
public:
explicit Target(content::WebContents* web_contents);
virtual std::string GetId() const OVERRIDE { return id_; }
virtual std::string GetType() const OVERRIDE { return kTargetTypePage; }
virtual std::string GetTitle() const OVERRIDE { return title_; }
virtual std::string GetDescription() const OVERRIDE { return std::string(); }
virtual GURL GetUrl() const OVERRIDE { return url_; }
virtual GURL GetFaviconUrl() const OVERRIDE { return favicon_url_; }
virtual base::TimeTicks GetLastActivityTime() const OVERRIDE {
return last_activity_time_;
}
virtual bool IsAttached() const OVERRIDE {
return agent_host_->IsAttached();
}
virtual scoped_refptr<content::DevToolsAgentHost> GetAgentHost() const
OVERRIDE {
return agent_host_;
}
virtual bool Activate() const OVERRIDE;
virtual bool Close() const OVERRIDE;
private:
scoped_refptr<content::DevToolsAgentHost> agent_host_;
std::string id_;
std::string title_;
GURL url_;
GURL favicon_url_;
base::TimeTicks last_activity_time_;
};
Target::Target(content::WebContents* web_contents) {
agent_host_ =
content::DevToolsAgentHost::GetOrCreateFor(
web_contents->GetRenderViewHost());
id_ = agent_host_->GetId();
title_ = UTF16ToUTF8(net::EscapeForHTML(web_contents->GetTitle()));
url_ = web_contents->GetURL();
content::NavigationController& controller = web_contents->GetController();
content::NavigationEntry* entry = controller.GetActiveEntry();
if (entry != NULL && entry->GetURL().is_valid())
favicon_url_ = entry->GetFavicon().url;
last_activity_time_ = web_contents->GetLastSelectedTime();
} }
std::string CefDevToolsBindingHandler::GetIdentifier( bool Target::Activate() const {
content::DevToolsAgentHost* agent_host) { content::RenderViewHost* rvh = agent_host_->GetRenderViewHost();
GarbageCollect(); if (!rvh)
return false;
const std::string& identifier = content::WebContents* web_contents =
GetIdentifier(agent_host->GetRenderViewHost()); content::WebContents::FromRenderViewHost(rvh);
agents_map_[identifier] = agent_host; if (!web_contents)
return identifier; return false;
web_contents->GetDelegate()->ActivateContents(web_contents);
return true;
} }
content::DevToolsAgentHost* CefDevToolsBindingHandler::ForIdentifier( bool Target::Close() const {
const std::string& identifier) { content::RenderViewHost* rvh = agent_host_->GetRenderViewHost();
GarbageCollect(); if (!rvh)
return false;
// Return the existing agent host, if any. rvh->ClosePage();
AgentsMap::const_iterator it = agents_map_.find(identifier); return true;
if (it != agents_map_.end())
return it->second;
// Iterate through the existing RVH instances to find a match.
for (content::RenderProcessHost::iterator it(
content::RenderProcessHost::AllHostsIterator());
!it.IsAtEnd(); it.Advance()) {
content::RenderProcessHost* render_process_host = it.GetCurrentValue();
DCHECK(render_process_host);
// Ignore processes that don't have a connection, such as crashed contents.
if (!render_process_host->HasConnection())
continue;
scoped_ptr<content::RenderWidgetHostIterator> widgets(
content::RenderWidgetHost::GetRenderWidgetHosts());
while (content::RenderWidgetHost* widget = widgets->GetNextHost()) {
if (!widget->IsRenderView())
continue;
content::RenderViewHost* host = content::RenderViewHost::From(widget);
if (GetIdentifier(host) == identifier) {
// May create a new agent host.
scoped_refptr<content::DevToolsAgentHost> agent_host(
content::DevToolsAgentHost::GetOrCreateFor(host));
agents_map_[identifier] = agent_host;
return agent_host;
}
}
}
return NULL;
}
std::string CefDevToolsBindingHandler::GetIdentifier(
content::RenderViewHost* rvh) {
int process_id = rvh->GetProcess()->GetID();
int routing_id = rvh->GetRoutingID();
if (random_seed_.empty()) {
// Generate a random seed that is used to make identifier guessing more
// difficult.
random_seed_ = base::StringPrintf("%lf|%u",
base::Time::Now().ToDoubleT(), base::RandInt(0, INT_MAX));
}
// Create a key that combines RVH IDs and the random seed.
std::string key = base::StringPrintf("%d|%d|%s",
process_id,
routing_id,
random_seed_.c_str());
// Return an MD5 hash of the key.
return base::MD5String(key);
}
void CefDevToolsBindingHandler::GarbageCollect() {
AgentsMap::iterator it = agents_map_.begin();
while (it != agents_map_.end()) {
if (!it->second->GetRenderViewHost())
agents_map_.erase(it++);
else
++it;
}
} }
} // namespace
// CefDevToolsDelegate // CefDevToolsDelegate
@@ -121,9 +112,6 @@ CefDevToolsDelegate::CefDevToolsDelegate(int port) {
new net::TCPListenSocketFactory("127.0.0.1", port), new net::TCPListenSocketFactory("127.0.0.1", port),
"", "",
this); this);
binding_.reset(new CefDevToolsBindingHandler());
devtools_http_handler_->SetDevToolsAgentHostBinding(binding_.get());
} }
CefDevToolsDelegate::~CefDevToolsDelegate() { CefDevToolsDelegate::~CefDevToolsDelegate() {
@@ -151,17 +139,43 @@ std::string CefDevToolsDelegate::GetPageThumbnailData(const GURL& url) {
return std::string(); return std::string();
} }
content::RenderViewHost* CefDevToolsDelegate::CreateNewTarget() { scoped_ptr<content::DevToolsTarget> CefDevToolsDelegate::CreateNewTarget() {
return NULL; return scoped_ptr<content::DevToolsTarget>();
} }
content::DevToolsHttpHandlerDelegate::TargetType scoped_ptr<content::DevToolsTarget> CefDevToolsDelegate::CreateTargetForId(
CefDevToolsDelegate::GetTargetType(content::RenderViewHost*) { const std::string& id) {
return kTargetTypeTab; scoped_ptr<content::DevToolsTarget> target;
std::vector<content::RenderViewHost*> rvh_list =
content::DevToolsAgentHost::GetValidRenderViewHosts();
for (std::vector<content::RenderViewHost*>::iterator it = rvh_list.begin();
it != rvh_list.end(); ++it) {
scoped_refptr<content::DevToolsAgentHost> agent_host(
content::DevToolsAgentHost::GetOrCreateFor(*it));
if (agent_host->GetId() == id) {
content::WebContents* web_contents =
content::WebContents::FromRenderViewHost(*it);
target.reset(new Target(web_contents));
break;
}
} }
std::string CefDevToolsDelegate::GetViewDescription(content::RenderViewHost*) { return target.Pass();
return std::string(); }
void CefDevToolsDelegate::EnumerateTargets(TargetCallback callback) {
TargetList targets;
std::vector<content::RenderViewHost*> rvh_list =
content::DevToolsAgentHost::GetValidRenderViewHosts();
for (std::vector<content::RenderViewHost*>::iterator it = rvh_list.begin();
it != rvh_list.end(); ++it) {
content::WebContents* web_contents =
content::WebContents::FromRenderViewHost(*it);
if (web_contents)
targets.push_back(new Target(web_contents));
}
callback.Run(targets);
} }
scoped_ptr<net::StreamListenSocket> scoped_ptr<net::StreamListenSocket>
@@ -181,8 +195,11 @@ std::string CefDevToolsDelegate::GetDevToolsURL(content::RenderViewHost* rvh,
if (!base::StringToInt(port_str, &port)) if (!base::StringToInt(port_str, &port))
return std::string(); return std::string();
std::string page_id = binding_->GetIdentifier(rvh); scoped_refptr<content::DevToolsAgentHost> agent_host(
std::string host = http_scheme ? content::DevToolsAgentHost::GetOrCreateFor(rvh));
const std::string& page_id = agent_host->GetId();
const std::string& host = http_scheme ?
base::StringPrintf("http://localhost:%d/devtools/", port) : base::StringPrintf("http://localhost:%d/devtools/", port) :
base::StringPrintf("%s://%s/devtools/", chrome::kChromeDevToolsScheme, base::StringPrintf("%s://%s/devtools/", chrome::kChromeDevToolsScheme,
scheme::kChromeDevToolsHost); scheme::kChromeDevToolsHost);

View File

@@ -20,33 +20,6 @@ namespace content {
class RenderViewHost; class RenderViewHost;
} }
class CefDevToolsBindingHandler
: public content::DevToolsHttpHandler::DevToolsAgentHostBinding {
public:
CefDevToolsBindingHandler();
// DevToolsAgentHostBinding overrides.
virtual std::string GetIdentifier(
content::DevToolsAgentHost* agent_host) OVERRIDE;
virtual content::DevToolsAgentHost* ForIdentifier(
const std::string& identifier) OVERRIDE;
std::string GetIdentifier(content::RenderViewHost* rvh);
private:
void GarbageCollect();
std::string random_seed_;
// Map of identifier to DevToolsAgentHost. Keeps the DevToolsAgentHost objects
// alive until the associated RVH is disconnected.
typedef std::map<std::string, scoped_refptr<content::DevToolsAgentHost> >
AgentsMap;
AgentsMap agents_map_;
DISALLOW_COPY_AND_ASSIGN(CefDevToolsBindingHandler);
};
class CefDevToolsDelegate : public content::DevToolsHttpHandlerDelegate { class CefDevToolsDelegate : public content::DevToolsHttpHandlerDelegate {
public: public:
explicit CefDevToolsDelegate(int port); explicit CefDevToolsDelegate(int port);
@@ -60,9 +33,10 @@ class CefDevToolsDelegate : public content::DevToolsHttpHandlerDelegate {
virtual bool BundlesFrontendResources() OVERRIDE; virtual bool BundlesFrontendResources() OVERRIDE;
virtual base::FilePath GetDebugFrontendDir() OVERRIDE; virtual base::FilePath GetDebugFrontendDir() OVERRIDE;
virtual std::string GetPageThumbnailData(const GURL& url) OVERRIDE; virtual std::string GetPageThumbnailData(const GURL& url) OVERRIDE;
virtual content::RenderViewHost* CreateNewTarget() OVERRIDE; virtual scoped_ptr<content::DevToolsTarget> CreateNewTarget() OVERRIDE;
virtual TargetType GetTargetType(content::RenderViewHost*) OVERRIDE; virtual scoped_ptr<content::DevToolsTarget> CreateTargetForId(
virtual std::string GetViewDescription(content::RenderViewHost*) OVERRIDE; const std::string& id) OVERRIDE;
virtual void EnumerateTargets(TargetCallback callback) OVERRIDE;
virtual scoped_ptr<net::StreamListenSocket> CreateSocketForTethering( virtual scoped_ptr<net::StreamListenSocket> CreateSocketForTethering(
net::StreamListenSocket::Delegate* delegate, net::StreamListenSocket::Delegate* delegate,
std::string* name) OVERRIDE; std::string* name) OVERRIDE;
@@ -72,7 +46,6 @@ class CefDevToolsDelegate : public content::DevToolsHttpHandlerDelegate {
private: private:
content::DevToolsHttpHandler* devtools_http_handler_; content::DevToolsHttpHandler* devtools_http_handler_;
scoped_ptr<CefDevToolsBindingHandler> binding_;
DISALLOW_COPY_AND_ASSIGN(CefDevToolsDelegate); DISALLOW_COPY_AND_ASSIGN(CefDevToolsDelegate);
}; };

View File

@@ -65,7 +65,6 @@ void CefResourceDispatcherHostDelegate::RequestBeginning(
ResourceType::Type resource_type, ResourceType::Type resource_type,
int child_id, int child_id,
int route_id, int route_id,
bool is_continuation_of_transferred_request,
ScopedVector<content::ResourceThrottle>* throttles) { ScopedVector<content::ResourceThrottle>* throttles) {
if (resource_type == ResourceType::MAIN_FRAME || if (resource_type == ResourceType::MAIN_FRAME ||
resource_type == ResourceType::SUB_FRAME) { resource_type == ResourceType::SUB_FRAME) {

View File

@@ -24,7 +24,6 @@ class CefResourceDispatcherHostDelegate
ResourceType::Type resource_type, ResourceType::Type resource_type,
int child_id, int child_id,
int route_id, int route_id,
bool is_continuation_of_transferred_request,
ScopedVector<content::ResourceThrottle>* throttles) OVERRIDE; ScopedVector<content::ResourceThrottle>* throttles) OVERRIDE;
virtual bool HandleExternalProtocol(const GURL& url, virtual bool HandleExternalProtocol(const GURL& url,
int child_id, int child_id,

View File

@@ -544,7 +544,7 @@ net::UploadDataStream* CefPostDataImpl::Get() {
static_cast<CefPostDataElementImpl*>(it->get())->Get()); static_cast<CefPostDataElementImpl*>(it->get())->Get());
} }
return new net::UploadDataStream(&element_readers, 0); return new net::UploadDataStream(element_readers.Pass(), 0);
} }
void CefPostDataImpl::Set(const WebKit::WebHTTPBody& data) { void CefPostDataImpl::Set(const WebKit::WebHTTPBody& data) {

View File

@@ -7,6 +7,7 @@
#include "config.h" #include "config.h"
MSVC_PUSH_WARNING_LEVEL(0); MSVC_PUSH_WARNING_LEVEL(0);
#include "bindings/v8/V8Binding.h"
#include "bindings/v8/V8RecursionScope.h" #include "bindings/v8/V8RecursionScope.h"
#include "bindings/v8/V8Utilities.h" #include "bindings/v8/V8Utilities.h"
MSVC_POP_WARNING(); MSVC_POP_WARNING();
@@ -546,7 +547,7 @@ void CefContentRendererClient::DidCreateScriptContext(
v8::HandleScope handle_scope(webkit_glue::GetV8Isolate(frame)); v8::HandleScope handle_scope(webkit_glue::GetV8Isolate(frame));
v8::Context::Scope scope(context); v8::Context::Scope scope(context);
WebCore::V8RecursionScope recursion_scope( WebCore::V8RecursionScope recursion_scope(
WebCore::getScriptExecutionContext()); WebCore::toExecutionContext(context));
CefRefPtr<CefV8Context> contextPtr(new CefV8ContextImpl(context)); CefRefPtr<CefV8Context> contextPtr(new CefV8ContextImpl(context));
@@ -579,7 +580,7 @@ void CefContentRendererClient::WillReleaseScriptContext(
v8::HandleScope handle_scope(webkit_glue::GetV8Isolate(frame)); v8::HandleScope handle_scope(webkit_glue::GetV8Isolate(frame));
v8::Context::Scope scope(context); v8::Context::Scope scope(context);
WebCore::V8RecursionScope recursion_scope( WebCore::V8RecursionScope recursion_scope(
WebCore::getScriptExecutionContext()); WebCore::toExecutionContext(context));
CefRefPtr<CefV8Context> contextPtr(new CefV8ContextImpl(context)); CefRefPtr<CefV8Context> contextPtr(new CefV8ContextImpl(context));

View File

@@ -14,7 +14,7 @@
#include "config.h" #include "config.h"
MSVC_PUSH_WARNING_LEVEL(0); MSVC_PUSH_WARNING_LEVEL(0);
#include "core/page/Frame.h" #include "core/frame/Frame.h"
#include "core/workers/WorkerGlobalScope.h" #include "core/workers/WorkerGlobalScope.h"
#include "bindings/v8/ScriptController.h" #include "bindings/v8/ScriptController.h"
#include "bindings/v8/V8Binding.h" #include "bindings/v8/V8Binding.h"
@@ -478,7 +478,7 @@ void GetCefString(v8::Handle<v8::String> str, CefString& out) {
// V8 function callback. // V8 function callback.
void FunctionCallbackImpl(const v8::FunctionCallbackInfo<v8::Value>& info) { void FunctionCallbackImpl(const v8::FunctionCallbackInfo<v8::Value>& info) {
WebCore::V8RecursionScope recursion_scope( WebCore::V8RecursionScope recursion_scope(
WebCore::toScriptExecutionContext(v8::Context::GetCurrent())); WebCore::toExecutionContext(v8::Context::GetCurrent()));
CefV8Handler* handler = CefV8Handler* handler =
static_cast<CefV8Handler*>(v8::External::Cast(*info.Data())->Value()); static_cast<CefV8Handler*>(v8::External::Cast(*info.Data())->Value());
@@ -516,7 +516,7 @@ void AccessorGetterCallbackImpl(
v8::Local<v8::String> property, v8::Local<v8::String> property,
const v8::PropertyCallbackInfo<v8::Value>& info) { const v8::PropertyCallbackInfo<v8::Value>& info) {
WebCore::V8RecursionScope recursion_scope( WebCore::V8RecursionScope recursion_scope(
WebCore::toScriptExecutionContext(v8::Context::GetCurrent())); WebCore::toExecutionContext(v8::Context::GetCurrent()));
v8::Handle<v8::Object> obj = info.This(); v8::Handle<v8::Object> obj = info.This();
@@ -554,7 +554,7 @@ void AccessorSetterCallbackImpl(
v8::Local<v8::Value> value, v8::Local<v8::Value> value,
const v8::PropertyCallbackInfo<void>& info) { const v8::PropertyCallbackInfo<void>& info) {
WebCore::V8RecursionScope recursion_scope( WebCore::V8RecursionScope recursion_scope(
WebCore::toScriptExecutionContext(v8::Context::GetCurrent())); WebCore::toExecutionContext(v8::Context::GetCurrent()));
v8::Handle<v8::Object> obj = info.This(); v8::Handle<v8::Object> obj = info.This();
@@ -599,8 +599,8 @@ v8::Local<v8::Value> CallV8Function(v8::Handle<v8::Context> context,
WebCore::WorkerScriptController::controllerForContext(); WebCore::WorkerScriptController::controllerForContext();
DCHECK(controller); DCHECK(controller);
if (controller) { if (controller) {
func_rv = WebCore::ScriptController::callFunctionWithInstrumentation( func_rv = WebCore::ScriptController::callFunction(
controller->workerGlobalScope()->scriptExecutionContext(), controller->workerGlobalScope()->executionContext(),
function, receiver, argc, args, isolate); function, receiver, argc, args, isolate);
} }
} }

View File

@@ -12,32 +12,37 @@ patches = [
'path': '../tools/gritsettings/', 'path': '../tools/gritsettings/',
}, },
{ {
# Fix Xcode 4 build on OS X Lion.
# http://codereview.chromium.org/8086022/ # http://codereview.chromium.org/8086022/
'name': 'build', 'name': 'build',
'path': '../build/', 'path': '../build/',
}, },
{ {
# Support loading of password protected zip archives.
# http://code.google.com/p/chromiumembedded/issues/detail?id=496 # http://code.google.com/p/chromiumembedded/issues/detail?id=496
'name': 'zlib', 'name': 'zlib',
'path': '../third_party/zlib/', 'path': '../third_party/zlib/',
}, },
{ {
# Avoid MessageLoop assertion on OS X.
# http://code.google.com/p/chromiumembedded/issues/detail?id=443 # http://code.google.com/p/chromiumembedded/issues/detail?id=443
'name': 'message_loop_443', 'name': 'message_loop_443',
'path': '../base/message_loop/', 'path': '../base/message_loop/',
}, },
{ {
# Disable event type assertion in WebNode::addEventListener.
# http://code.google.com/p/chromiumembedded/issues/detail?id=933 # http://code.google.com/p/chromiumembedded/issues/detail?id=933
'name': 'webkit_933', 'name': 'webkit_933',
'path': '../third_party/WebKit/Source/web/', 'path': '../third_party/WebKit/Source/web/',
}, },
{ {
# Fix ninja output for localization directories on OS X.
# http://code.google.com/p/gyp/issues/detail?id=331 # http://code.google.com/p/gyp/issues/detail?id=331
'name': 'gyp_331', 'name': 'gyp_331',
'path': '../tools/gyp/pylib/', 'path': '../tools/gyp/pylib/',
}, },
{ {
# Enable popups in offscreen rendering on Mac # Enable popups in offscreen rendering on OS X.
'name': 'webkit_popups', 'name': 'webkit_popups',
'path': '../third_party/WebKit/', 'path': '../third_party/WebKit/',
}, },
@@ -48,6 +53,13 @@ patches = [
'path': '../ui/base/cocoa/', 'path': '../ui/base/cocoa/',
}, },
{ {
# Support direct access to DevTools URLs.
# https://codereview.chromium.org/27600002/
'name': 'devtools_target',
'path': '../content/',
},
{
# Disable scollbar bounce and overlay on OS X.
# http://code.google.com/p/chromiumembedded/issues/detail?id=364 # http://code.google.com/p/chromiumembedded/issues/detail?id=364
'name': 'spi_webcore_364', 'name': 'spi_webcore_364',
'path': '../third_party/WebKit/Source/core/', 'path': '../third_party/WebKit/Source/core/',

View File

@@ -0,0 +1,43 @@
Index: browser/devtools/devtools_http_handler_impl.cc
===================================================================
--- browser/devtools/devtools_http_handler_impl.cc (revision 228917)
+++ browser/devtools/devtools_http_handler_impl.cc (working copy)
@@ -542,9 +542,17 @@
DevToolsTarget* DevToolsHttpHandlerImpl::GetTarget(const std::string& id) {
TargetMap::const_iterator it = target_map_.find(id);
- if (it == target_map_.end())
- return NULL;
- return it->second;
+ if (it != target_map_.end())
+ return it->second;
+
+ scoped_ptr<DevToolsTarget> target(delegate_->CreateTargetForId(id));
+ if (target) {
+ DCHECK_EQ(id, target->GetId());
+ target_map_[id] = target.release();
+ return target_map_[id];
+ }
+
+ return NULL;
}
void DevToolsHttpHandlerImpl::OnThumbnailRequestUI(
Index: public/browser/devtools_http_handler_delegate.h
===================================================================
--- public/browser/devtools_http_handler_delegate.h (revision 228917)
+++ public/browser/devtools_http_handler_delegate.h (working copy)
@@ -39,6 +39,13 @@
// Creates new inspectable target.
virtual scoped_ptr<DevToolsTarget> CreateNewTarget() = 0;
+ // Creates an inspectable target for the specified |id|. Called in cases where
+ // the target has not been enumerated (for example, direct URL access where
+ // the discovery JSON was not loaded first). This method was added for
+ // Chromium Embedded Framework.
+ virtual scoped_ptr<DevToolsTarget> CreateTargetForId(
+ const std::string& id) = 0;
+
typedef std::vector<DevToolsTarget*> TargetList;
typedef base::Callback<void(const TargetList&)> TargetCallback;

View File

@@ -1,8 +1,8 @@
Index: page/FrameView.cpp Index: frame/FrameView.cpp
=================================================================== ===================================================================
--- page/FrameView.cpp (revision 158192) --- frame/FrameView.cpp (revision 159695)
+++ page/FrameView.cpp (working copy) +++ frame/FrameView.cpp (working copy)
@@ -189,8 +189,10 @@ @@ -198,8 +198,10 @@
if (!isMainFrame()) if (!isMainFrame())
return; return;
@@ -15,9 +15,9 @@ Index: page/FrameView.cpp
PassRefPtr<FrameView> FrameView::create(Frame* frame) PassRefPtr<FrameView> FrameView::create(Frame* frame)
Index: platform/mac/NSScrollerImpDetails.mm Index: platform/mac/NSScrollerImpDetails.mm
=================================================================== ===================================================================
--- platform/mac/NSScrollerImpDetails.mm (revision 158192) --- platform/mac/NSScrollerImpDetails.mm (revision 159695)
+++ platform/mac/NSScrollerImpDetails.mm (working copy) +++ platform/mac/NSScrollerImpDetails.mm (working copy)
@@ -34,6 +34,7 @@ @@ -33,6 +33,7 @@
bool isScrollbarOverlayAPIAvailable() bool isScrollbarOverlayAPIAvailable()
{ {
@@ -25,7 +25,7 @@ Index: platform/mac/NSScrollerImpDetails.mm
static bool apiAvailable; static bool apiAvailable;
static bool shouldInitialize = true; static bool shouldInitialize = true;
if (shouldInitialize) { if (shouldInitialize) {
@@ -44,6 +45,9 @@ @@ -43,6 +44,9 @@
&& [scrollerImpPairClass instancesRespondToSelector:@selector(scrollerStyle)]; && [scrollerImpPairClass instancesRespondToSelector:@selector(scrollerStyle)];
} }
return apiAvailable; return apiAvailable;

View File

@@ -1,20 +1,20 @@
Index: public/web/WebView.h Index: public/web/WebView.h
=================================================================== ===================================================================
--- public/web/WebView.h (revision 158192) --- public/web/WebView.h (revision 159695)
+++ public/web/WebView.h (working copy) +++ public/web/WebView.h (working copy)
@@ -444,6 +444,7 @@ @@ -447,6 +447,7 @@
// Sets whether select popup menus should be rendered by the browser. // Sets whether select popup menus should be rendered by the browser.
WEBKIT_EXPORT static void setUseExternalPopupMenus(bool); BLINK_EXPORT static void setUseExternalPopupMenus(bool);
+ virtual void setUseExternalPopupMenusThisInstance(bool) = 0; + virtual void setUseExternalPopupMenusThisInstance(bool) = 0;
// Visited link state -------------------------------------------------- // Visited link state --------------------------------------------------
Index: Source/web/ChromeClientImpl.cpp Index: Source/web/ChromeClientImpl.cpp
=================================================================== ===================================================================
--- Source/web/ChromeClientImpl.cpp (revision 158192) --- Source/web/ChromeClientImpl.cpp (revision 159695)
+++ Source/web/ChromeClientImpl.cpp (working copy) +++ Source/web/ChromeClientImpl.cpp (working copy)
@@ -878,7 +878,7 @@ @@ -875,7 +875,7 @@
PassRefPtr<PopupMenu> ChromeClientImpl::createPopupMenu(Frame& frame, PopupMenuClient* client) const PassRefPtr<PopupMenu> ChromeClientImpl::createPopupMenu(Frame& frame, PopupMenuClient* client) const
{ {
@@ -25,17 +25,17 @@ Index: Source/web/ChromeClientImpl.cpp
return adoptRef(new PopupMenuChromium(frame, client)); return adoptRef(new PopupMenuChromium(frame, client));
Index: Source/web/WebViewImpl.cpp Index: Source/web/WebViewImpl.cpp
=================================================================== ===================================================================
--- Source/web/WebViewImpl.cpp (revision 158192) --- Source/web/WebViewImpl.cpp (revision 159695)
+++ Source/web/WebViewImpl.cpp (working copy) +++ Source/web/WebViewImpl.cpp (working copy)
@@ -397,6 +397,7 @@ @@ -411,6 +411,7 @@
, m_fakePageScaleAnimationPageScaleFactor(0) , m_fakePageScaleAnimationPageScaleFactor(0)
, m_fakePageScaleAnimationUseAnchor(false) , m_fakePageScaleAnimationUseAnchor(false)
, m_contextMenuAllowed(false) , m_contextMenuAllowed(false)
+ , m_shouldUseExternalPopupMenus(shouldUseExternalPopupMenus) + , m_shouldUseExternalPopupMenus(shouldUseExternalPopupMenus)
, m_doingDragAndDrop(false) , m_doingDragAndDrop(false)
, m_ignoreInputEvents(false) , m_ignoreInputEvents(false)
, m_suppressNextKeypressEvent(false) , m_compositorDeviceScaleFactorOverride(0)
@@ -3709,9 +3710,14 @@ @@ -3751,9 +3752,14 @@
updateLayerTreeViewport(); updateLayerTreeViewport();
} }
@@ -53,9 +53,9 @@ Index: Source/web/WebViewImpl.cpp
void WebViewImpl::startDragging(Frame* frame, void WebViewImpl::startDragging(Frame* frame,
Index: Source/web/WebViewImpl.h Index: Source/web/WebViewImpl.h
=================================================================== ===================================================================
--- Source/web/WebViewImpl.h (revision 158192) --- Source/web/WebViewImpl.h (revision 159695)
+++ Source/web/WebViewImpl.h (working copy) +++ Source/web/WebViewImpl.h (working copy)
@@ -422,7 +422,8 @@ @@ -424,7 +424,8 @@
// Returns true if popup menus should be rendered by the browser, false if // Returns true if popup menus should be rendered by the browser, false if
// they should be rendered by WebKit (which is the default). // they should be rendered by WebKit (which is the default).
@@ -65,7 +65,7 @@ Index: Source/web/WebViewImpl.h
bool contextMenuAllowed() const bool contextMenuAllowed() const
{ {
@@ -723,6 +724,8 @@ @@ -727,6 +728,8 @@
bool m_contextMenuAllowed; bool m_contextMenuAllowed;