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

Side by Side Diff: Source/web/WebDOMError.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/WebBlob.cpp ('k') | Source/web/WebDOMFileSystem.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) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 return m_private->name(); 60 return m_private->name();
61 } 61 }
62 62
63 WebString WebDOMError::message() const 63 WebString WebDOMError::message() const
64 { 64 {
65 if (!m_private.get()) 65 if (!m_private.get())
66 return WebString(); 66 return WebString();
67 return m_private->message(); 67 return m_private->message();
68 } 68 }
69 69
70 v8::Local<v8::Value> WebDOMError::toV8Value(v8::Local<v8::Object> /* creationCo ntext */, v8::Isolate* isolate) 70 v8::Local<v8::Value> WebDOMError::toV8Value(v8::Local<v8::Object> creationConte xt, v8::Isolate* isolate)
71 { 71 {
72 // We no longer use |creationContext| because it's often misused and points 72 // We no longer use |creationContext| because it's often misused and points
73 // to a context faked by user script. 73 // to a context faked by user script.
74 ASSERT(creationContext->CreationContext() == isolate->GetCurrentContext());
74 if (!m_private.get()) 75 if (!m_private.get())
75 return v8::Local<v8::Value>(); 76 return v8::Local<v8::Value>();
76 return toV8(m_private.get(), isolate->GetCurrentContext()->Global(), isolate ); 77 return toV8(m_private.get(), isolate->GetCurrentContext()->Global(), isolate );
77 } 78 }
78 79
79 WebDOMError::WebDOMError(DOMError* error) 80 WebDOMError::WebDOMError(DOMError* error)
80 : m_private(error) 81 : m_private(error)
81 { 82 {
82 } 83 }
83 84
84 WebDOMError& WebDOMError::operator=(DOMError* error) 85 WebDOMError& WebDOMError::operator=(DOMError* error)
85 { 86 {
86 m_private = error; 87 m_private = error;
87 return *this; 88 return *this;
88 } 89 }
89 90
90 } // namespace blink 91 } // namespace blink
OLDNEW
« no previous file with comments | « Source/web/WebBlob.cpp ('k') | Source/web/WebDOMFileSystem.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698