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

Side by Side Diff: public/platform/WebThreadSafeData.h

Issue 462843003: Cleanup namespace usage in public/platform/{Web[P-W]*,linux/*}.h (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 4 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
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 20 matching lines...) Expand all
31 #ifndef WebThreadSafeData_h 31 #ifndef WebThreadSafeData_h
32 #define WebThreadSafeData_h 32 #define WebThreadSafeData_h
33 33
34 #include "WebCommon.h" 34 #include "WebCommon.h"
35 #include "WebPrivatePtr.h" 35 #include "WebPrivatePtr.h"
36 36
37 #if !INSIDE_BLINK 37 #if !INSIDE_BLINK
38 #include <string> 38 #include <string>
39 #endif 39 #endif
40 40
41 namespace blink { class RawData; } 41 namespace blink {
42 42
43 namespace blink { 43 class RawData;
44 44
45 // A container for raw bytes. It is inexpensive to copy a WebThreadSafeData obje ct. 45 // A container for raw bytes. It is inexpensive to copy a WebThreadSafeData obje ct.
46 // It is safe to pass a WebThreadSafeData across threads!!! 46 // It is safe to pass a WebThreadSafeData across threads!!!
47 class WebThreadSafeData { 47 class WebThreadSafeData {
48 public: 48 public:
49 WebThreadSafeData() { } 49 WebThreadSafeData() { }
50 ~WebThreadSafeData() { reset(); } 50 ~WebThreadSafeData() { reset(); }
51 51
52 BLINK_PLATFORM_EXPORT void assign(const WebThreadSafeData&); 52 BLINK_PLATFORM_EXPORT void assign(const WebThreadSafeData&);
53 BLINK_PLATFORM_EXPORT void reset(); 53 BLINK_PLATFORM_EXPORT void reset();
54 54
55 BLINK_PLATFORM_EXPORT size_t size() const; 55 BLINK_PLATFORM_EXPORT size_t size() const;
56 BLINK_PLATFORM_EXPORT const char* data() const; 56 BLINK_PLATFORM_EXPORT const char* data() const;
57 57
58 bool isEmpty() const { return !size(); } 58 bool isEmpty() const { return !size(); }
59 59
60 #if INSIDE_BLINK 60 #if INSIDE_BLINK
61 BLINK_PLATFORM_EXPORT WebThreadSafeData(const WTF::PassRefPtr<blink::RawData >&); 61 BLINK_PLATFORM_EXPORT WebThreadSafeData(const WTF::PassRefPtr<RawData>&);
62 BLINK_PLATFORM_EXPORT WebThreadSafeData& operator=(const WTF::PassRefPtr<bli nk::RawData>&); 62 BLINK_PLATFORM_EXPORT WebThreadSafeData& operator=(const WTF::PassRefPtr<Raw Data>&);
63 #else 63 #else
64 operator std::string() const 64 operator std::string() const
65 { 65 {
66 size_t len = size(); 66 size_t len = size();
67 return len ? std::string(data(), len) : std::string(); 67 return len ? std::string(data(), len) : std::string();
68 } 68 }
69 #endif 69 #endif
70 70
71 private: 71 private:
72 WebPrivatePtr<blink::RawData> m_private; 72 WebPrivatePtr<RawData> m_private;
73 }; 73 };
74 74
75 } // namespace blink 75 } // namespace blink
76 76
77 #endif 77 #endif
OLDNEW
« no previous file with comments | « public/platform/WebStorageQuotaCallbacks.h ('k') | public/platform/WebTransformAnimationCurve.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698