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

Side by Side Diff: third_party/WebKit/Source/platform/bindings/ScriptWrappable.h

Issue 2851563004: Add documentation for platform/bindings (Closed)
Patch Set: Address code review Created 3 years, 7 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2010 Google Inc. All rights reserved. 2 * Copyright (C) 2010 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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 TraceWrapperBase() = default; 49 TraceWrapperBase() = default;
50 virtual bool IsScriptWrappable() const { return false; } 50 virtual bool IsScriptWrappable() const { return false; }
51 51
52 DECLARE_VIRTUAL_TRACE_WRAPPERS(){}; 52 DECLARE_VIRTUAL_TRACE_WRAPPERS(){};
53 }; 53 };
54 54
55 // ScriptWrappable provides a way to map from/to C++ DOM implementation to/from 55 // ScriptWrappable provides a way to map from/to C++ DOM implementation to/from
56 // JavaScript object (platform object). ToV8() converts a ScriptWrappable to 56 // JavaScript object (platform object). ToV8() converts a ScriptWrappable to
57 // a v8::Object and toScriptWrappable() converts a v8::Object back to 57 // a v8::Object and toScriptWrappable() converts a v8::Object back to
58 // a ScriptWrappable. v8::Object as platform object is called "wrapper object". 58 // a ScriptWrappable. v8::Object as platform object is called "wrapper object".
59 // The wrapepr object for the main world is stored in ScriptWrappable. Wrapper 59 // The wrapper object for the main world is stored in ScriptWrappable. Wrapper
60 // objects for other worlds are stored in DOMWrapperMap. 60 // objects for other worlds are stored in DOMWrapperMap.
61 class PLATFORM_EXPORT ScriptWrappable : public TraceWrapperBase { 61 class PLATFORM_EXPORT ScriptWrappable : public TraceWrapperBase {
62 WTF_MAKE_NONCOPYABLE(ScriptWrappable); 62 WTF_MAKE_NONCOPYABLE(ScriptWrappable);
63 63
64 public: 64 public:
65 ScriptWrappable() {} 65 ScriptWrappable() {}
66 66
67 bool IsScriptWrappable() const override { return true; } 67 bool IsScriptWrappable() const override { return true; }
68 68
69 template <typename T> 69 template <typename T>
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
204 #define DECLARE_WRAPPERTYPEINFO() \ 204 #define DECLARE_WRAPPERTYPEINFO() \
205 public: \ 205 public: \
206 const WrapperTypeInfo* GetWrapperTypeInfo() const override; \ 206 const WrapperTypeInfo* GetWrapperTypeInfo() const override; \
207 \ 207 \
208 private: \ 208 private: \
209 typedef void end_of_define_wrappertypeinfo_not_reached_t 209 typedef void end_of_define_wrappertypeinfo_not_reached_t
210 210
211 } // namespace blink 211 } // namespace blink
212 212
213 #endif // ScriptWrappable_h 213 #endif // ScriptWrappable_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698