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

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

Issue 1181943005: bindings: Adds ASSERTs to check the creation context passed to public APIs. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 6 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/WebArrayBufferConverter.cpp ('k') | Source/web/WebDOMError.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) 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2011 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 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 m_private = other.m_private; 72 m_private = other.m_private;
73 } 73 }
74 74
75 WebString WebBlob::uuid() 75 WebString WebBlob::uuid()
76 { 76 {
77 if (!m_private.get()) 77 if (!m_private.get())
78 return WebString(); 78 return WebString();
79 return m_private->uuid(); 79 return m_private->uuid();
80 } 80 }
81 81
82 v8::Local<v8::Value> WebBlob::toV8Value(v8::Local<v8::Object> /* creationContext */, v8::Isolate* isolate) 82 v8::Local<v8::Value> WebBlob::toV8Value(v8::Local<v8::Object> creationContext, v 8::Isolate* isolate)
83 { 83 {
84 // We no longer use |creationContext| because it's often misused and points 84 // We no longer use |creationContext| because it's often misused and points
85 // to a context faked by user script. 85 // to a context faked by user script.
86 ASSERT(creationContext->CreationContext() == isolate->GetCurrentContext());
86 if (!m_private.get()) 87 if (!m_private.get())
87 return v8::Local<v8::Value>(); 88 return v8::Local<v8::Value>();
88 return toV8(m_private.get(), isolate->GetCurrentContext()->Global(), isolate ); 89 return toV8(m_private.get(), isolate->GetCurrentContext()->Global(), isolate );
89 } 90 }
90 91
91 WebBlob::WebBlob(Blob* blob) 92 WebBlob::WebBlob(Blob* blob)
92 : m_private(blob) 93 : m_private(blob)
93 { 94 {
94 } 95 }
95 96
96 WebBlob& WebBlob::operator=(Blob* blob) 97 WebBlob& WebBlob::operator=(Blob* blob)
97 { 98 {
98 m_private = blob; 99 m_private = blob;
99 return *this; 100 return *this;
100 } 101 }
101 102
102 } // namespace blink 103 } // namespace blink
OLDNEW
« no previous file with comments | « Source/web/WebArrayBufferConverter.cpp ('k') | Source/web/WebDOMError.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698