OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2011, 2012 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 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 | 124 |
125 private: | 125 private: |
126 bool didHitError(FileError* error) | 126 bool didHitError(FileError* error) |
127 { | 127 { |
128 reportResult(error->code()); | 128 reportResult(error->code()); |
129 return true; | 129 return true; |
130 } | 130 } |
131 | 131 |
132 bool didGetEntry(Entry*); | 132 bool didGetEntry(Entry*); |
133 | 133 |
134 void reportResult(FileError::ErrorCode errorCode, PassRefPtr<TypeBuilder::Fi
leSystem::Entry> entry = 0) | 134 void reportResult(FileError::ErrorCode errorCode, PassRefPtr<TypeBuilder::Fi
leSystem::Entry> entry = nullptr) |
135 { | 135 { |
136 m_requestCallback->sendSuccess(static_cast<int>(errorCode), entry); | 136 m_requestCallback->sendSuccess(static_cast<int>(errorCode), entry); |
137 } | 137 } |
138 | 138 |
139 FileSystemRootRequest(PassRefPtr<RequestFileSystemRootCallback> requestCallb
ack, const String& type) | 139 FileSystemRootRequest(PassRefPtr<RequestFileSystemRootCallback> requestCallb
ack, const String& type) |
140 : m_requestCallback(requestCallback) | 140 : m_requestCallback(requestCallback) |
141 , m_type(type) { } | 141 , m_type(type) { } |
142 | 142 |
143 RefPtr<RequestFileSystemRootCallback> m_requestCallback; | 143 RefPtr<RequestFileSystemRootCallback> m_requestCallback; |
144 String m_type; | 144 String m_type; |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
195 private: | 195 private: |
196 bool didHitError(FileError* error) | 196 bool didHitError(FileError* error) |
197 { | 197 { |
198 reportResult(error->code()); | 198 reportResult(error->code()); |
199 return true; | 199 return true; |
200 } | 200 } |
201 | 201 |
202 bool didGetEntry(Entry*); | 202 bool didGetEntry(Entry*); |
203 bool didReadDirectoryEntries(const EntryVector&); | 203 bool didReadDirectoryEntries(const EntryVector&); |
204 | 204 |
205 void reportResult(FileError::ErrorCode errorCode, PassRefPtr<Array<TypeBuild
er::FileSystem::Entry> > entries = 0) | 205 void reportResult(FileError::ErrorCode errorCode, PassRefPtr<Array<TypeBuild
er::FileSystem::Entry> > entries = nullptr) |
206 { | 206 { |
207 m_requestCallback->sendSuccess(static_cast<int>(errorCode), entries); | 207 m_requestCallback->sendSuccess(static_cast<int>(errorCode), entries); |
208 } | 208 } |
209 | 209 |
210 DirectoryContentRequest(PassRefPtr<RequestDirectoryContentCallback> requestC
allback, const String& url) | 210 DirectoryContentRequest(PassRefPtr<RequestDirectoryContentCallback> requestC
allback, const String& url) |
211 : m_requestCallback(requestCallback) | 211 : m_requestCallback(requestCallback) |
212 , m_url(ParsedURLString, url) { } | 212 , m_url(ParsedURLString, url) { } |
213 | 213 |
214 void readDirectoryEntries(); | 214 void readDirectoryEntries(); |
215 | 215 |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
316 private: | 316 private: |
317 bool didHitError(FileError* error) | 317 bool didHitError(FileError* error) |
318 { | 318 { |
319 reportResult(error->code()); | 319 reportResult(error->code()); |
320 return true; | 320 return true; |
321 } | 321 } |
322 | 322 |
323 bool didGetEntry(Entry*); | 323 bool didGetEntry(Entry*); |
324 bool didGetMetadata(Metadata*); | 324 bool didGetMetadata(Metadata*); |
325 | 325 |
326 void reportResult(FileError::ErrorCode errorCode, PassRefPtr<TypeBuilder::Fi
leSystem::Metadata> metadata = 0) | 326 void reportResult(FileError::ErrorCode errorCode, PassRefPtr<TypeBuilder::Fi
leSystem::Metadata> metadata = nullptr) |
327 { | 327 { |
328 m_requestCallback->sendSuccess(static_cast<int>(errorCode), metadata); | 328 m_requestCallback->sendSuccess(static_cast<int>(errorCode), metadata); |
329 } | 329 } |
330 | 330 |
331 MetadataRequest(PassRefPtr<RequestMetadataCallback> requestCallback, const S
tring& url) | 331 MetadataRequest(PassRefPtr<RequestMetadataCallback> requestCallback, const S
tring& url) |
332 : m_requestCallback(requestCallback) | 332 : m_requestCallback(requestCallback) |
333 , m_url(ParsedURLString, url) { } | 333 , m_url(ParsedURLString, url) { } |
334 | 334 |
335 RefPtr<RequestMetadataCallback> m_requestCallback; | 335 RefPtr<RequestMetadataCallback> m_requestCallback; |
336 KURL m_url; | 336 KURL m_url; |
(...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
717 for (Frame* frame = m_page->mainFrame(); frame; frame = frame->tree().traver
seNext()) { | 717 for (Frame* frame = m_page->mainFrame(); frame; frame = frame->tree().traver
seNext()) { |
718 if (frame->document() && frame->document()->securityOrigin()->isSameSche
meHostPort(origin)) | 718 if (frame->document() && frame->document()->securityOrigin()->isSameSche
meHostPort(origin)) |
719 return frame->document(); | 719 return frame->document(); |
720 } | 720 } |
721 | 721 |
722 *error = "No frame is available for the request"; | 722 *error = "No frame is available for the request"; |
723 return 0; | 723 return 0; |
724 } | 724 } |
725 | 725 |
726 } // namespace WebCore | 726 } // namespace WebCore |
OLD | NEW |