Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(152)

Side by Side Diff: webkit/renderer/cpp_bound_class.cc

Issue 61553006: Rename WebKit namespace to blink (part 5) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « webkit/renderer/cpp_bound_class.h ('k') | webkit/renderer/cpp_variant.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // This file contains definitions for CppBoundClass 5 // This file contains definitions for CppBoundClass
6 6
7 // Here's the control flow of a JS method getting forwarded to a class. 7 // Here's the control flow of a JS method getting forwarded to a class.
8 // - Something calls our NPObject with a function like "Invoke". 8 // - Something calls our NPObject with a function like "Invoke".
9 // - CppNPObject's static invoke() function forwards it to its attached 9 // - CppNPObject's static invoke() function forwards it to its attached
10 // CppBoundClass's Invoke() method. 10 // CppBoundClass's Invoke() method.
11 // - CppBoundClass has then overridden Invoke() to look up the function 11 // - CppBoundClass has then overridden Invoke() to look up the function
12 // name in its internal map of methods, and then calls the appropriate 12 // name in its internal map of methods, and then calls the appropriate
13 // method. 13 // method.
14 14
15 #include "webkit/renderer/cpp_bound_class.h" 15 #include "webkit/renderer/cpp_bound_class.h"
16 16
17 #include "base/compiler_specific.h" 17 #include "base/compiler_specific.h"
18 #include "base/logging.h" 18 #include "base/logging.h"
19 #include "base/stl_util.h" 19 #include "base/stl_util.h"
20 #include "base/strings/utf_string_conversions.h" 20 #include "base/strings/utf_string_conversions.h"
21 #include "third_party/WebKit/public/web/WebBindings.h" 21 #include "third_party/WebKit/public/web/WebBindings.h"
22 #include "third_party/WebKit/public/web/WebFrame.h" 22 #include "third_party/WebKit/public/web/WebFrame.h"
23 #include "third_party/WebKit/public/platform/WebString.h" 23 #include "third_party/WebKit/public/platform/WebString.h"
24 24
25 using WebKit::WebBindings; 25 using blink::WebBindings;
26 using WebKit::WebFrame; 26 using blink::WebFrame;
27 27
28 namespace webkit_glue { 28 namespace webkit_glue {
29 29
30 namespace { 30 namespace {
31 31
32 class CppVariantPropertyCallback : public CppBoundClass::PropertyCallback { 32 class CppVariantPropertyCallback : public CppBoundClass::PropertyCallback {
33 public: 33 public:
34 CppVariantPropertyCallback(CppVariant* value) : value_(value) { } 34 CppVariantPropertyCallback(CppVariant* value) : value_(value) { }
35 35
36 virtual bool GetValue(CppVariant* value) OVERRIDE { 36 virtual bool GetValue(CppVariant* value) OVERRIDE {
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after
320 // BindToWindowObject will take its own reference to the NPObject, and clean 320 // BindToWindowObject will take its own reference to the NPObject, and clean
321 // up after itself. It will also (indirectly) register the object with V8, 321 // up after itself. It will also (indirectly) register the object with V8,
322 // against an owner pointer we supply, so we must register that as an owner, 322 // against an owner pointer we supply, so we must register that as an owner,
323 // and unregister when we teardown. 323 // and unregister when we teardown.
324 frame->bindToWindowObject(ASCIIToUTF16(classname), 324 frame->bindToWindowObject(ASCIIToUTF16(classname),
325 NPVARIANT_TO_OBJECT(*GetAsCppVariant())); 325 NPVARIANT_TO_OBJECT(*GetAsCppVariant()));
326 bound_to_frame_ = true; 326 bound_to_frame_ = true;
327 } 327 }
328 328
329 } // namespace webkit_glue 329 } // namespace webkit_glue
OLDNEW
« no previous file with comments | « webkit/renderer/cpp_bound_class.h ('k') | webkit/renderer/cpp_variant.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698