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

Side by Side Diff: Source/web/WebBindings.cpp

Issue 398673003: Rename WebCore namespace to blink in bindings and web (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 5 months 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 | « Source/web/WebArrayBufferView.cpp ('k') | Source/web/WebBlob.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2009 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 #include "bindings/core/v8/npruntime_priv.h" 44 #include "bindings/core/v8/npruntime_priv.h"
45 #include "core/dom/Range.h" 45 #include "core/dom/Range.h"
46 #include "core/frame/LocalDOMWindow.h" 46 #include "core/frame/LocalDOMWindow.h"
47 #include "core/frame/LocalFrame.h" 47 #include "core/frame/LocalFrame.h"
48 #include "public/platform/WebArrayBuffer.h" 48 #include "public/platform/WebArrayBuffer.h"
49 #include "public/web/WebArrayBufferView.h" 49 #include "public/web/WebArrayBufferView.h"
50 #include "public/web/WebElement.h" 50 #include "public/web/WebElement.h"
51 #include "public/web/WebRange.h" 51 #include "public/web/WebRange.h"
52 #include "wtf/ArrayBufferView.h" 52 #include "wtf/ArrayBufferView.h"
53 53
54 using namespace WebCore; 54 using namespace blink;
55 55
56 namespace blink { 56 namespace blink {
57 57
58 bool WebBindings::construct(NPP npp, NPObject* object, const NPVariant* args, ui nt32_t argCount, NPVariant* result) 58 bool WebBindings::construct(NPP npp, NPObject* object, const NPVariant* args, ui nt32_t argCount, NPVariant* result)
59 { 59 {
60 return _NPN_Construct(npp, object, args, argCount, result); 60 return _NPN_Construct(npp, object, args, argCount, result);
61 } 61 }
62 62
63 NPObject* WebBindings::createObject(NPP npp, NPClass* npClass) 63 NPObject* WebBindings::createObject(NPP npp, NPClass* npClass)
64 { 64 {
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 return 0; 178 return 0;
179 } 179 }
180 180
181 void WebBindings::unregisterObject(NPObject* object) 181 void WebBindings::unregisterObject(NPObject* object)
182 { 182 {
183 _NPN_UnregisterObject(object); 183 _NPN_UnregisterObject(object);
184 } 184 }
185 185
186 void WebBindings::dropV8WrapperForObject(NPObject* object) 186 void WebBindings::dropV8WrapperForObject(NPObject* object)
187 { 187 {
188 WebCore::forgetV8ObjectForNPObject(object); 188 blink::forgetV8ObjectForNPObject(object);
189 } 189 }
190 190
191 NPUTF8* WebBindings::utf8FromIdentifier(NPIdentifier identifier) 191 NPUTF8* WebBindings::utf8FromIdentifier(NPIdentifier identifier)
192 { 192 {
193 return _NPN_UTF8FromIdentifier(identifier); 193 return _NPN_UTF8FromIdentifier(identifier);
194 } 194 }
195 195
196 void WebBindings::extractIdentifierData(const NPIdentifier& identifier, const NP UTF8*& string, int32_t& number, bool& isString) 196 void WebBindings::extractIdentifierData(const NPIdentifier& identifier, const NP UTF8*& string, int32_t& number, bool& isString)
197 { 197 {
198 PrivateIdentifier* data = static_cast<PrivateIdentifier*>(identifier); 198 PrivateIdentifier* data = static_cast<PrivateIdentifier*>(identifier);
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after
369 return makeIntArrayImpl(data, v8::Isolate::GetCurrent()); 369 return makeIntArrayImpl(data, v8::Isolate::GetCurrent());
370 } 370 }
371 371
372 NPObject* WebBindings::makeStringArray(const WebVector<WebString>& data) 372 NPObject* WebBindings::makeStringArray(const WebVector<WebString>& data)
373 { 373 {
374 return makeStringArrayImpl(data, v8::Isolate::GetCurrent()); 374 return makeStringArrayImpl(data, v8::Isolate::GetCurrent());
375 } 375 }
376 376
377 void WebBindings::pushExceptionHandler(ExceptionHandler handler, void* data) 377 void WebBindings::pushExceptionHandler(ExceptionHandler handler, void* data)
378 { 378 {
379 WebCore::pushExceptionHandler(handler, data); 379 blink::pushExceptionHandler(handler, data);
380 } 380 }
381 381
382 void WebBindings::popExceptionHandler() 382 void WebBindings::popExceptionHandler()
383 { 383 {
384 WebCore::popExceptionHandler(); 384 blink::popExceptionHandler();
385 } 385 }
386 386
387 void WebBindings::toNPVariant(v8::Local<v8::Value> object, NPObject* root, NPVar iant* result) 387 void WebBindings::toNPVariant(v8::Local<v8::Value> object, NPObject* root, NPVar iant* result)
388 { 388 {
389 WebCore::convertV8ObjectToNPVariant(object, root, result, v8::Isolate::GetCu rrent()); 389 blink::convertV8ObjectToNPVariant(object, root, result, v8::Isolate::GetCurr ent());
390 } 390 }
391 391
392 v8::Handle<v8::Value> WebBindings::toV8Value(const NPVariant* variant) 392 v8::Handle<v8::Value> WebBindings::toV8Value(const NPVariant* variant)
393 { 393 {
394 v8::Isolate* isolate = v8::Isolate::GetCurrent(); 394 v8::Isolate* isolate = v8::Isolate::GetCurrent();
395 if (variant->type == NPVariantType_Object) { 395 if (variant->type == NPVariantType_Object) {
396 NPObject* object = NPVARIANT_TO_OBJECT(*variant); 396 NPObject* object = NPVARIANT_TO_OBJECT(*variant);
397 V8NPObject* v8Object = npObjectToV8NPObject(object); 397 V8NPObject* v8Object = npObjectToV8NPObject(object);
398 if (!v8Object) 398 if (!v8Object)
399 return v8::Undefined(isolate); 399 return v8::Undefined(isolate);
400 return convertNPVariantToV8Object(variant, v8Object->rootObject->frame() ->script().windowScriptNPObject(), isolate); 400 return convertNPVariantToV8Object(variant, v8Object->rootObject->frame() ->script().windowScriptNPObject(), isolate);
401 } 401 }
402 // Safe to pass 0 since we have checked the script object class to make sure the 402 // Safe to pass 0 since we have checked the script object class to make sure the
403 // argument is a primitive v8 type. 403 // argument is a primitive v8 type.
404 return convertNPVariantToV8Object(variant, 0, isolate); 404 return convertNPVariantToV8Object(variant, 0, isolate);
405 } 405 }
406 406
407 } // namespace blink 407 } // namespace blink
OLDNEW
« no previous file with comments | « Source/web/WebArrayBufferView.cpp ('k') | Source/web/WebBlob.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698